home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utilsys / rss14gmd.lha / RSys_1.4gmd / Asm / RSysSprintf.asm < prev    next >
Assembly Source File  |  1996-04-08  |  812b  |  34 lines

  1.    ;
  2.    ; Simple version of the C "sprintf" function.  Assumes C-style
  3.    ; stack-based function conventions.
  4.    ;
  5.  
  6. ;GMD    CSECT __MERGED
  7.     CSECT __BBB
  8.  
  9.       XDEF     _sprintf
  10.       XREF     _SysBase
  11.       XREF     _LVORawDoFmt
  12.  
  13.    _sprintf:                        ; ( ostring, format, {values} )
  14.       movem.l  a2/a3/a6,-(sp)
  15.  
  16.       move.l   4*4(sp),a3           ;Get the output string pointer
  17.       move.l   5*4(sp),a0           ;Get the FormatString pointer
  18.       lea.l    6*4(sp),a1           ;Get the pointer to the DataStream
  19.  
  20.       lea.l    stuffChar(pc),a2
  21.  
  22.       move.l   _SysBase,a6
  23.       jsr      _LVORawDoFmt(a6)
  24.  
  25.       movem.l  (sp)+,a2/a3/a6
  26.       rts
  27.  
  28.    ;------ PutChProc function used by RawDoFmt -----------
  29.    stuffChar:
  30.       move.b   d0,(a3)+        ;Put data to output string
  31.       rts
  32.  
  33.     END
  34.